package reduce.fz.com.reduce.abstracts;

import com.alibaba.fastjson.TypeReference;
import com.android.volley.Response;
import com.android.volley.Response.ErrorListener;
import com.android.volley.VolleyError;

import reduce.fz.com.reduce.bean.User;
import reduce.fz.com.reduce.bean.result.Result;
import reduce.fz.com.reduce.util.JsonUtil;

/**
 * Created by qingshengzheng on 15/7/26.
 */
public abstract class AbResponseListener3<T> implements Response.Listener, ErrorListener {
    @Override
    public void onErrorResponse(VolleyError volleyError) {

    }

    @Override
    public void onResponse(Object o) {
        Result<T> result = JsonUtil.convert(o.toString(), new TypeReference<Result<T>>() {
        });
        responseInfo(result);

    }
    public abstract void responseInfo(Result<T> data);

}
